home *** CD-ROM | disk | FTP | other *** search
- 'FMA Script Framework Plugin
- 'BSPlayer
- 'Lets you control BSPlayer
-
- 'TODO:
- '-Testing
-
- Class BSPlayer
-
- Private llist
- Private m_Self
- Private m_BSPlayerZoom
- Private mainMenu
-
- 'Some info about the plugin
- Public Property Get SHOWABLE 'Do I have a menu?
- SHOWABLE = True
- End Property
- Public Property Get TITLE 'What's my name?
- TITLE = "BSPlayer"
- End Property
- Public Property Get DESCRIPTION 'What's my purpose?
- DESCRIPTION = "Lets you control BSPlayer"
- End Property
- Public Property Get AUTHOR 'Who created me?
- AUTHOR = "streawkceur (inspired by CarpeDi3m)"
- End Property
- Public Property Get URL 'Were can I be found? Where can you get more information?
- URL = "http://fma.xinium.com/"
- End Property
-
- 'Who am I?
- Public Property Let Self (s)
- m_Self = s
- ' Some init stuff here:
- If IsEmpty(Settings(Me, "Title")) or Settings(Me, "Title") = "" Then Settings(Me, "Title") = "BSPlayer"
- If IsEmpty(Settings(Me, "Exe")) or Settings(Me, "Exe") = "" Then Settings(Me, "Exe") = "C:\Program Files\Cyberlink\BSPlayer\BSPlayer.exe"
- m_BSPlayerZoom = 0
- Set mainMenu = New ManagedMenu
- End Property
- Public Property Get Self
- Self = m_Self
- End Property
-
- 'Display me. Eventually put a menu on the screen
- Sub Show()
- '--> Init Menu
- Set llist = New LinkedList
- Dim bi
- bi = llist.BackInserter
- If BSPlayerOpen Then
- bi.Item = Array("Play", Self & ".Play")
- bi.Item = Array("Pause", Self & ".Pause")
- bi.Item = Array("Stop", Self & ".Stopp")
- bi.Item = Array("Prev Chapter", Self & ".PrevChapter")
- bi.Item = Array("Next Chapter", Self & ".NextChapter")
- bi.Item = Array("Subtitles", Self & ".SubTitles")
- bi.Item = Array("Fullscreen", Self & ".Fullscreen")
- bi.Item = Array("Zoom", Self & ".Zoom")
- bi.Item = Array("Close", Self & ".Close")
- Else
- bi.Item = Array("Launch", Self & ".Launch")
- End If
- mainMenu.SetList llist
-
- mainMenu.Title = TITLE
- mainMenu.ShowMenu
- End Sub
-
- Function BSPlayerOpen
- BSPlayerOpen = Shell.AppActivate(Settings(Me, "Title"))
- End Function
-
- Sub Launch
- If Fso.FileExists(Settings(Me, "Exe")) Then
- Shell.Exec Settings(Me, "Exe")
- Util.WaitForAppLoad Settings(Me, "Title"), 10000 'Give BSPlayer max. 10 secs to load
- Else
- Debug.ErrorMsg Self & " - Launch: File not found: " & Settings(Me, "Exe")
- End If
- Show
- End Sub
-
- Sub Close
- If BSPlayerOpen Then
- Shell.SendKeys "%{F4}"
- Util.Sleep 5000 'Give BsPlayer 3secs to close itself
- End If
- Show
- End Sub
-
- Sub Play
- If BSPlayerOpen Then Shell.SendKeys "x"
- am.Update
- End Sub
-
- Sub Pause
- If BSPlayerOpen Then Shell.SendKeys "c"
- am.Update
- End Sub
-
- Sub Stopp
- If BSPlayerOpen Then Shell.SendKeys "v"
- am.Update
- End Sub
-
- Sub PrevChapter
- If BSPlayerOpen Then Shell.SendKeys "z"
- am.Update
- End Sub
-
- Sub NextChapter
- If BSPlayerOpen Then Shell.SendKeys "b"
- am.Update
- End Sub
-
- Sub SubTitles
- If BSPlayerOpen Then Shell.SendKeys "s"
- am.Update
- End Sub
-
- Sub Fullscreen
- If BSPlayerOpen Then Shell.SendKeys "f"
- am.Update
- End Sub
-
- Sub Zoom
- m_BSPlayerZoom = (m_BSPlayerZoom + 1) Mod 3
- If BSPlayerOpen Then Shell.SendKeys (m_BSPlayerZoom + 1)
- am.Update
- End Sub
-
- End Class
-
-